package org.tobie.order.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.tobie.order.entity.OrdersEntity;

import java.util.Date;
import java.util.List;


/**
 * @author: lzd
 * TODO
 * 2023/10/20 16:07
 */
@Mapper
public interface OrderDao extends BaseMapper<OrdersEntity>{
    /**
     * 保存订单信息
     */
    @Insert("insert into orders(name,order_id,total,pay_time,u_account) values(#{subject},#{tradeNo},#{totalAmount},#{payTime},#{userAccount})")
    Boolean saveList(@Param("subject") String subject, @Param("tradeNo") String tradeNo, @Param("totalAmount")String totalAmount, @Param("payTime") Date payTime ,@Param("userAccount") String userAccount);
    /**
     * 获取某个用户的全部订单
     */
    List<OrdersEntity> getOrders(String userAccount);
    /**
     * 查询订单信息
     */
    List<OrdersEntity> findMsg( @Param("selectMsg")String selectMsg,@Param("userAccount") String userAccount);
    /**
     * 获取订单页最大页码
     */
    int getMaxPageNum(String userAccount);
}
